#!/bin/sh

echo "*** Process for KLOXO service ***"

ret="no"

if [ ! -f /usr/local/lxlabs/kloxo/init/kloxo-hiawatha.pid ] ; then
	ret="yes"
fi

if [ ! -f /usr/local/lxlabs/kloxo/init/kloxo_use_php-cgi ] ; then
	if [ ! -f /usr/local/lxlabs/kloxo/init/kloxo-phpcgi.pid ] ; then
		if [ -f /usr/local/lxlabs/kloxo/init/kloxo-phpcgi.sock ] ; then
			'rm' -f /usr/local/lxlabs/kloxo/init/kloxo-phpcgi.sock
		fi

		ret="yes"
	fi
fi

if [ "${ret}" == "yes" ] ; then
	/etc/rc.d/init.d/kloxo start
fi

echo "  - Process: restart"
/etc/rc.d/init.d/kloxo restart
